package com.crscd.ai.config;

import com.alibaba.cloud.ai.dashscope.api.DashScopeApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 9/29/25 12:36 PM
 * @modifiedBy:
 * @version: 1.0
 */
@Configuration
public class SaaLLMConfig {
  // 方式1：通过@Value的方式获取api-key
  @Value("${spring.ai.dashscope.api-key}")
  private String apiKey;

  @Bean
  public DashScopeApi dashScopeApi() {
    return DashScopeApi.builder().apiKey(apiKey).build();
  }

  // 方式2：使用System.getenv()获取api-key
}
